
<?php

/**
 * @author Dang Quoc Viet
 * @copyright 2009
 */
	
	$this->pageTitle = 'Thong tin phieu dieu tra bay den';
?>
<div class="actions">
	<ul>
		<li><?php  if ($curUser['User']['ROLE'] != 'admin')
						echo $html->link('Sửa phiếu bẫy đèn', array('action' => 'nhapthongtin', $phieu['PDtBd']['id'])); ?> </li>
							
		<li><?php  if ($curUser['User']['ROLE'] != 'admin')
						echo $html->link('Xóa phiếu bẫy đèn', array('action' => 'delete', $phieu['PDtBd']['id']), null, sprintf(__('Bạn thật sự muốn xóa phiếu này?', true), $phieu['PDtBd']['id'])); ?> </li><br/>
	
		<li><?php echo $html->link('Danh sách Phiếu', array('action' => 'index')); ?> </li>
	
		<li><?php  if ($curUser['User']['ROLE'] != 'admin')
						echo $html->link('Thêm Phiếu', array('action' => 'add')); ?> </li>
<!--		<li><?php  if ($curUser['User']['ROLE'] != 'admin')
						echo $html->link('In ấn', array('action' => 'viewPdf',$phieu['PDtBd']['id'])); ?> 
<li><?php 
						echo $html->link('Xuất pdf','http://localhost/lua/tcpdf/ex/example_008.php'); ?>
	</li> -->
	<li><?php // if ($curUser['User']['ROLE'] != 'admin')
						echo $html->link('Xuất PDF', array('action' => 'xuatpdf', $phieu['PDtBd']['id'])); ?> </li>
	</ul>
</div>
<div class="pDtBds view">
	<h2><?php echo 'Thông tin phiếu điều tra bẫy đèn';?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php echo 'Chi cục BVTV'; ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $chicuc['ChicucBvtv']['TEN_CC']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php echo 'Trạm BVTV'; ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $tram['Trambvtv']['TEN_TR']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php echo 'Cán bộ điều tra'; ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $cb['Canbo']['HOTEN']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php echo 'Ngày điều tra'; ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo date('d-m-Y',strtotime($phieu['PDtBd']['NGAY_PBD'])); ?>
			&nbsp;
		</dd>
	</dl>

 		<table>
			<tr>
				<th><?php echo 'STT';?></th>
				<th><?php echo 'Đối tượng';?></th>
				<th><?php echo 'Số lượng trưởng thành/bẫy';?></th>
				<th><?php echo 'Ghi chú';?></th>
			</tr>
		<?php 
		$i = 0;
		$j = 0;
		foreach($doituongs as $dt){
			$class = null;			
			if ($j++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
			<tr<?php echo $class;?>>
				<td>
					<?php 
						echo $form->label(null,$i+1);
					?>
				</td>
				<td>
					<?php echo $form->label(null,isset($dt['Doituong']['TEN_DT'])?$dt['Doituong']['TEN_DT']:null);?>
				</td>
				<td>
					<?php echo $form->label(null, isset($dt['KqBd']['SL_TREN_BD'])?$dt['KqBd']['SL_TREN_BD']:null);?>
				</td>
				<td>
					<?php echo $form->label(null, isset($dt['KqBd']['ghichu'])?$dt['KqBd']['ghichu']:null);?>
				</td>
			</tr>
		<?php
			$i++;
		}	
		?>
		</table>


